import request from '@/utils/request'

// 查询还款计划明细列表
export function listDealServicingPlan(query) {
  return request({
    url: '/plan/dealServicingPlan/list',
    method: 'get',
    params: query
  })
}

// 查询还款计划明细详细
export function getDealServicingPlan(id) {
  return request({
    url: '/plan/dealServicingPlan/' + id,
    method: 'get'
  })
}

// 保存还款计划明细
export function saveDealServicingPlan(data) {
  return request({
    url: '/plan/dealServicingPlan/save',
    method: 'post',
    data: data
  })
}

// 删除还款计划明细
export function delDealServicingPlan(id) {
  return request({
    url: '/plan/dealServicingPlan/' + id,
    method: 'delete'
  })
}

// 导出还款计划明细
export function exportDealServicingPlan(query) {
  return request({
    url: '/plan/dealServicingPlan/export',
    method: 'get',
    params: query
  })
}

// 查询近30天未还款数据
export function findLastThirtyDaysNotPlan(param) {
  return request({
    url: '/plan/dealServicingPlan/findLastThirtyDaysNotPlan/' + param.dealId,
    method: 'get',
    params: param
  })
}

// 保存最近还款计划
export function saveLastExpect(array) {
  return request({
    url: '/plan/dealServicingPlan/saveLastExpect',
    method: 'post',
    data: array
  })
}

// 最新(预计付款时间)还款计划
export function findLatestServicingPlan(query) {
  return request({
    url: '/plan/dealServicingPlan/findLatestServicingPlan',
    method: 'get',
    params: query
  })
}
